/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("mes_virtualrfiddata2",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using VolPro.Entity.DomainModels;
using VolPro.MES.IServices;

namespace VolPro.MES.Controllers
{
    public partial class mes_virtualrfiddata2Controller
    {
        private readonly Imes_virtualrfiddata2Service _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;

        [ActivatorUtilitiesConstructor]
        public mes_virtualrfiddata2Controller(
            Imes_virtualrfiddata2Service service,
            IHttpContextAccessor httpContextAccessor
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
        }
        /// <summary>
        /// 读库写TAG
        /// </summary>
        /// <returns></returns>
        //[HttpPost, Route("MES_UserPost"), AllowAnonymous]
        [HttpPost, Route("MES_TAGFormSQL"), AllowAnonymous]
        public async Task<IActionResult> MES_TAGFormSQL(string sN, string opName)
        {
            return JsonNormal(await Service.MES_TAGFormSQL(sN, opName));
        }
        /// <summary>
        /// 读TAG写库
        /// </summary>
        /// <returns></returns>
        //[HttpPost, Route("MES_UserPost"), AllowAnonymous]
        [HttpPost, Route("MES_TAGToSQL"), AllowAnonymous]
        public async Task<IActionResult> MES_TAGToSQL(string sN, string opName)
        {
            return JsonNormal(await Service.MES_TAGToSQL(sN, opName));
        }
    }
}
